import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
		isToken: localStorage.getItem('user') || null,
		username: localStorage.getItem('userName') || null
  },
  getters: {
  },
  mutations: {
		setToken(state,token){
			state.isToken = token
			localStorage.setItem("user",token)
		},
		setUsername(state,name){
			state.username = name
			localStorage.setItem("userName",name)
		}
  },
  actions: {
  },
  modules: {
  }
})
